package com.weiaibenpao.demo.chislim.presenter;

import com.weiaibenpao.demo.chislim.base.BasePresenter;
import com.weiaibenpao.demo.chislim.bean.DjqMarathonBean;
import com.weiaibenpao.demo.chislim.retrofit.RetrofitUtils;
import com.weiaibenpao.demo.chislim.retrofit.rx.NetWorkTransformer;
import com.weiaibenpao.demo.chislim.retrofit.rx.SimpleObserver;
import com.weiaibenpao.demo.chislim.view.DjqMarathonView;

/**
 * Created by wlx on 2017/12/13.
 */

public class DjqMarathonPresenter extends BasePresenter<DjqMarathonView> {
    public void getDjqMarathon(int page,int size){
        RetrofitUtils.getAPIService().getDjqMarathon(page,size).
                compose(new NetWorkTransformer<DjqMarathonBean>()).
                subscribe(new SimpleObserver<DjqMarathonBean>(mCompositeDisposable) {
                    @Override
                    public void call(DjqMarathonBean djqMarathonBean) {
                        getView().djqMarathonSuccess(djqMarathonBean);
                    }

                });
    }
}
